<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="basePath" scope="session" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>用户信息</title>
<script type="text/javascript" src="${basePath}/resources/mutiLang/zh-cn.js"></script>
<script type="text/javascript" src="${basePath}/resources/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${basePath}/resources/js/jquery.cookie.js"></script>
<script type="text/javascript" src="${basePath}/resources/js/jquery.storageapi.min.js"></script>
<script type="text/javascript" src="${basePath}/resources/tools/dataformat.js"></script>
<link id="easyuiTheme" rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/metro/easyui.css" type="text/css">
<link id="easyuiTheme" rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/metro/main.css" type="text/css">
<link rel="stylesheet" href="${basePath}/resources/esayUI/1.3.2/themes/icon.css" type="text/css">
<link rel="stylesheet" type="text/css" href="${basePath}/resources/accordion/css/accordion.css">
<script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/locale/zh-cn.js"></script>
<script type="text/javascript" src="${basePath}/resources/tools/syUtil.js"></script>
<script type="text/javascript" src="${basePath}/resources/esayUI/1.3.2/extends/datagrid-scrollview.js"></script>
<link rel="stylesheet" href="${basePath}/resources/tools/css/metro/common.css" type="text/css">
<script type="text/javascript" src="${basePath}/resources/lhgDialog/lhgdialog.min.js?skin=metro"></script>
<script type="text/javascript" src="${basePath}/resources/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="${basePath}/resources/tools/easyuiextend.js"></script>
<script type="text/javascript" src="${basePath}/resources/hftable/jquery-hftable.js"></script>
<script type="text/javascript" src="${basePath}/resources/tools/json2.js"></script>
</head>
<body style="overflow-y: hidden" scroll="no">
<form id="formobj" action="${basePath}/admin/user/add" name="formobj" method="post">
    <input type="hidden" id="btn_sub" class="btn_sub">
	<input id="id" name="id" type="hidden" value="0">
	<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
		<tbody><tr>
			<td align="right" width="15%" nowrap="">
                <label class="Validform_label">  用户名: </label>
            </td>
			<td class="value" width="85%">
                   <input id="userName" class="inputxt" name="username" validtype="t_s_base_user,userName,id" value="" datatype="s2-10">
                   <span class="Validform_checktip"> 用户名范围在2~10位字符</span>
            </td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap=""><label class="Validform_label"> 真实姓名: </label></td>
			<td class="value" width="10%">
                <input id="realName" class="inputxt" name="realName" value="" datatype="s2-10">
                <span class="Validform_checktip">填写个人真实姓名</span>
            </td>
		</tr>
		
			<tr>
				<td align="right"><label class="Validform_label"> 密码: </label></td>
				<td class="value">
                    <input type="password" class="inputxt" value="" name="password" plugin="passwordStrength" datatype="*6-18" errormsg="">
                    <span class="passwordStrength" style="display: none;">
                        <span>弱</span>
                        <span>中</span>
                        <span class="last">强</span>
                    </span>
                    <span class="Validform_checktip"> 密码至少6个字符,最多18个字符</span>
                </td>
			</tr>
			<tr>
				<td align="right"><label class="Validform_label"> 重复密码: </label></td>
				<td class="value">
                    <input id="repassword" class="inputxt" type="password" value="" recheck="password" datatype="*6-18" errormsg="两次输入的密码不一致！">
                    <span class="Validform_checktip">重复密码</span>
                </td>
			</tr>
		<tr>
			<td align="right"><label class="Validform_label"> 角色: </label></td>
			<td class="value" nowrap="">
                <input name="roleid" type="hidden" value="" id="roleid">
                <input name="roleName" class="inputxt" value="" id="roleName" readonly="readonly" datatype="*">
				 <a href="javascript:void(0)" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="choose_402881e65306c0c4015306c253200001()">选择</a>
                <a href="#" class="easyui-linkbutton l-btn l-btn-plain" plain="true" icon="icon-redo" onclick="" id="">清空</a>
                <span class="Validform_checktip">角色可多选</span>
				<script type = "text/javascript" >
				var windowapi = frameElement.api,
				W = windowapi.opener;
				function choose_402881e65306c0c4015306c253200001() {
				    var url = 'role/list';
				    var initValue = $('#roleid').val();
				  //  url += '&ids=' + initValue;
				    if (typeof(windowapi) == 'undefined') {
				        $.dialog({
				            content: 'url:' + url,
				            zIndex: 2100,
				            title: '角色列表',
				            lock: true,
				            width: 400,
				            height: 350,
				            left: '85%',
				            top: '65%',
				            opacity: 0.4,
				            button: [{
				                name: '确定',
				                callback: clickcallback_402881e65306c0c4015306c253200001,
				                focus: true
				            },
				            {
				                name: '取消',
				                callback: function() {}
				            }]
				        });
				    } else {
				        $.dialog({
				            content: 'url:' + url,
				            zIndex: 2100,
				            title: '角色列表',
				            lock: true,
				            parent: windowapi,
				            width: 400,
				            height: 350,
				            left: '85%',
				            top: '65%',
				            opacity: 0.4,
				            button: [{
				                name: '确定',
				                callback: clickcallback_402881e65306c0c4015306c253200001,
				                focus: true
				            },
				            {
				                name: '取消',
				                callback: function() {}
				            }]
				        });
				    }
				}
				function clearAll_402881e65306c0c4015306c253200001() {
				    if ($('#roleName').length >= 1) {
				        $('#roleName').val('');
				        $('#roleName').blur();
				    }
				    if ($("input[name='roleName']").length >= 1) {
				        $("input[name='roleName']").val('');
				        $("input[name='roleName']").blur();
				    }
				    $('#roleid').val("");
				}
				function clickcallback_402881e65306c0c4015306c253200001() {
				    iframe = this.iframe.contentWindow;
				    var roleName = iframe.getroleListSelections('name');
				    if ($('#roleName').length >= 1) {
				        $('#roleName').val(roleName);
				        $('#roleName').blur();
				    }
				    if ($("input[name='roleName']").length >= 1) {
				        $("input[name='roleName']").val(roleName);
				        $("input[name='roleName']").blur();
				    }
				    var id = iframe.getroleListSelections('id');
				    if (id !== undefined && id != "") {
				        $('#roleid').val(id);
				    }
				} </script>
            </td>
		</tr>
		
		<tr>
			<td align="right" nowrap=""><label class="Validform_label">  手机号码: </label></td>
			<td class="value">
                <input class="inputxt" name="mobilePhone" value="" datatype="m" errormsg="手机号码不正确" ignore="ignore">
                <span class="Validform_checktip"></span>
            </td>
		</tr>
		<tr>
			<td align="right"><label class="Validform_label"> 办公电话: </label></td>
			<td class="value">
                <input class="inputxt" name="officePhone" value="" datatype="n" errormsg="办公室电话不正确" ignore="ignore">
                <span class="Validform_checktip"></span>
            </td>
		</tr>
		<tr>
			<td align="right"><label class="Validform_label"> 常用邮箱: </label></td>
			<td class="value">
                <input class="inputxt" name="email" value="" datatype="e" errormsg="邮箱格式不正确!" ignore="ignore">
                <span class="Validform_checktip"></span>
            </td>
		</tr>
	</tbody></table>
<link rel="stylesheet" href="${basePath}/resources/Validform/css/metro/style.css" type="text/css">
<link rel="stylesheet" href="${basePath}/resources/Validform/css/metro/tablefrom.css" type="text/css">

<script type="text/javascript" src="${basePath}/resources/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
<script type="text/javascript" src="${basePath}/resources/Validform/js/Validform_Datatype_zh-cn.js"></script>
<script type="text/javascript" src="${basePath}/resources/Validform/js/datatype_zh-cn.js"></script>

<script type="text/javascript" src="${basePath}/resources/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
<script type = "text/javascript" > $(function() {
    $("#formobj").Validform({
        tiptype: 4,
        btnSubmit: "#btn_sub",
        btnReset: "#btn_reset",
        ajaxPost: true,
        usePlugin: {
            passwordstrength: {
                minLen: 6,
                maxLen: 18,
                trigger: function(obj, error) {
                    if (error) {
                        obj.parent().next().find(".Validform_checktip").show();
                        obj.find(".passwordStrength").hide();
                    } else {
                        $(".passwordStrength").show();
                        obj.parent().next().find(".Validform_checktip").hide();
                    }
                }
            }
        },
        callback: function(data) {
            var win = frameElement.api.opener;
            if (data.result == 1) {
                frameElement.api.close();
                win.tip(data.msg);
            } else {
                 $.messager.alert('错误', data.msg);
                 $.Hidemsg();
             	 return false;
            }
            win.reloadTable();
        }
    });
}); </script>
</form > 
</body>
</html>
